#include <unistd.h>
#include <stdio.h>
#include <string.h>
#define N 100

const char*lables = "|/-\\";

void process()
{
  char buffer[N];
  memset(buffer,'\0',sizeof(buffer));
  int cnt = 0;

  while(cnt<N)
  {
    buffer[cnt++] = '#';
    printf("[%-100s][%d%%] ... [%c]\r",buffer,cnt,lables[cnt%4]);
    fflush(stdout);
    usleep(20000);
  }
}

int main()
{
  process();
}
